package lab01;

import java.util.Scanner;

/**
 * Created by 星月 on 2017/10/9.
 */
public class Test13 {
    public static void main(String[] args) {
        int unit;
        int ten;
        int hundred;
        System.out.println("请输入1-1000的数字：");
        Scanner num=new Scanner(System.in);
        int i=num.nextInt();
        unit=i%10;
        ten=i/10%10;
        hundred=i/100%10;
        if(hundred!=0){
            if(i==hundred*hundred*hundred+ten*ten*ten+unit*unit*unit){
                System.out.println(i+"是水仙花数");
            }else
                System.out.println(i+"不是水仙花数");
        }else                                              //水仙花数是三位数
            System.out.println(i+"不是水仙花数");
    }
}
